<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>瓦片图层 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.5.4">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="preload" href="/my/assets/css/0.styles.810d4cba.css" as="style"><link rel="preload" href="/my/assets/js/app.2dbd0b81.js" as="script"><link rel="preload" href="/my/assets/js/493.009afff8.js" as="script"><link rel="preload" href="/my/assets/js/1468.6b63431e.js" as="script"><link rel="preload" href="/my/assets/js/1246.59f69ef0.js" as="script"><link rel="preload" href="/my/assets/js/1031.8d6cd2c9.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.810d4cba.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link router-link-active">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link router-link-active">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/my/ui/map/" aria-current="page" class="sidebar-link">新德汇地图应用类库</a></li><li><a href="/my/ui/map/map.html" aria-current="page" class="active sidebar-link">瓦片图层</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#指定层级和中心点" class="sidebar-link">指定层级和中心点</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#适配地图类型" class="sidebar-link">适配地图类型</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#禁用滚轮缩放和拖拽移动" class="sidebar-link">禁用滚轮缩放和拖拽移动</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#自定义瓦片图层适配" class="sidebar-link">自定义瓦片图层适配</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#适配url" class="sidebar-link">适配URL</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#适配函数" class="sidebar-link">适配函数</a></li></ul></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#事件" class="sidebar-link">事件</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#图层颜色反相" class="sidebar-link">图层颜色反相</a></li><li class="sidebar-sub-header"><a href="/my/ui/map/map.html#预设滤镜" class="sidebar-link">预设滤镜</a></li></ul></li><li><a href="/my/ui/map/geo.html" class="sidebar-link">GeoJSON</a></li><li><a href="/my/ui/map/palette.html" class="sidebar-link">调色工具</a></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>覆盖物组件</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>控件组件</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>动效组件</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>工具函数</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="瓦片图层"><a href="#瓦片图层" class="header-anchor">#</a> 瓦片图层</h1> <p>地图瓦片基础图层，是地图应用的根组件。 组件文档 <a href="/my/api/map.html?url=%2Fmy%2Fapi%2Fmap%2Fmodule-%24ui_map_my-map.html" target="_blank" data-v-3de95506>MyMap <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound" data-v-3de95506 data-v-3de95506><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <!----><h2 id="指定层级和中心点"><a href="#指定层级和中心点" class="header-anchor">#</a> 指定层级和中心点</h2> <!----><h2 id="适配地图类型"><a href="#适配地图类型" class="header-anchor">#</a> 适配地图类型</h2> <p>预设了以下地图的适配：</p> <p>互联网</p> <ul><li>OSM</li> <li>Amap</li> <li>Baidu</li> <li>TDT</li></ul> <p>PGIS厂商</p> <ul><li>Founder 方正</li> <li>Ez 山海经纬</li> <li>Super 超图</li> <li>Fc 航天长峰、航天精一</li></ul> <!----><h2 id="禁用滚轮缩放和拖拽移动"><a href="#禁用滚轮缩放和拖拽移动" class="header-anchor">#</a> 禁用滚轮缩放和拖拽移动</h2> <!----><h2 id="自定义瓦片图层适配"><a href="#自定义瓦片图层适配" class="header-anchor">#</a> 自定义瓦片图层适配</h2> <h3 id="适配url"><a href="#适配url" class="header-anchor">#</a> 适配URL</h3> <!----><h3 id="适配函数"><a href="#适配函数" class="header-anchor">#</a> 适配函数</h3> <!----><h2 id="事件"><a href="#事件" class="header-anchor">#</a> 事件</h2> <p>MyMap 支持 <code>ol/Map</code>的全部事件，并扩展支持 <code>ready</code> 和 图层上的Feature 鼠标 进入<code>mouseenter</code> 、离开<code>mouseleave</code> 事件</p> <!----><h2 id="图层颜色反相"><a href="#图层颜色反相" class="header-anchor">#</a> 图层颜色反相</h2> <!----><h2 id="预设滤镜"><a href="#预设滤镜" class="header-anchor">#</a> 预设滤镜</h2> <!----><p>ol/Map 事件清单：</p> <ul><li><code>change</code> (module:ol/events/Event~BaseEvent) - Generic change event. Triggered when the revision counter is increased.</li> <li><code>change:layerGroup</code> (module:ol/Object.ObjectEvent)</li> <li><code>change:size</code> (module:ol/Object.ObjectEvent)</li> <li><code>change:target</code> (module:ol/Object.ObjectEvent)</li> <li><code>change:view</code> (module:ol/Object.ObjectEvent)</li> <li><code>click</code> (module:ol/MapBrowserEvent~MapBrowserEvent) - A click with no dragging. A double click will fire two of this.</li> <li><code>dblclick</code> (module:ol/MapBrowserEvent~MapBrowserEvent) - A true double click, with no dragging.</li> <li><code>error</code> (module:ol/events/Event~BaseEvent) - Generic error event. Triggered when an error occurs.</li> <li><code>moveend</code> (module:ol/MapEvent~MapEvent) - Triggered after the map is moved.</li> <li><code>movestart</code> (module:ol/MapEvent~MapEvent) - Triggered when the map starts moving.</li> <li><code>pointerdrag</code> (module:ol/MapBrowserEvent~MapBrowserEvent) - Triggered when a pointer is dragged.</li> <li><code>pointermove</code> (module:ol/MapBrowserEvent~MapBrowserEvent) - Triggered when a pointer is moved. Note that on touch devices this is triggered when the map is panned, so is not the same as mousemove.</li> <li><code>postcompose</code> (module:ol/render/Event~RenderEvent) - Triggered after all layers are rendered. The event object will not have a context set.</li> <li><code>postrender</code> (module:ol/MapEvent~MapEvent) - Triggered after a map frame is rendered.</li> <li><code>precompose</code> (module:ol/render/Event~RenderEvent) - Triggered before layers are rendered. The event object will not have a context set.</li> <li><code>propertychange</code> (module:ol/Object.ObjectEvent) - Triggered when a property is changed.</li> <li><code>rendercomplete</code> (module:ol/render/Event~RenderEvent) - Triggered when rendering is complete, i.e. all sources and tiles have finished loading for the current viewport, and all tiles are faded in. The event object will not have a context set.</li> <li><code>singleclick</code> (module:ol/MapBrowserEvent~MapBrowserEvent) - A true single click with no dragging and no double click. Note that this event is delayed by 250 ms to ensure that it is not a double click.</li></ul></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/ui/map/" class="prev router-link-active">
        新德汇地图应用类库
      </a></span> <span class="next"><a href="/my/ui/map/geo.html">
        GeoJSON
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.2dbd0b81.js" defer></script><script src="/my/assets/js/493.009afff8.js" defer></script><script src="/my/assets/js/1468.6b63431e.js" defer></script><script src="/my/assets/js/1246.59f69ef0.js" defer></script><script src="/my/assets/js/1031.8d6cd2c9.js" defer></script>
  </body>
</html>
